<template>
    <el-container class="home">
        <!--        头部导航-->
        <el-header class="header ub main-justify cross-center">
            <div class="header-left ub main-left">
                <div class="ub main-center arrowIcon cross-center">
                    <i
                            :class="[isCollapse ? 'el-icon-s-unfold' : ' el-icon-s-fold']"
                            @click="iconClick">
                    </i>
                </div>
                <div class="header-title">门店后台管理系统</div>
            </div>
            <div class="header-info ub main-center cross-center">
                <div class="header-info-avatar ub main-center cross-center">
                    <el-dropdown placement="top-start">
                        <img src="../assets/images/avatar.jpg" style="width: 50px;height: 50px;border-radius: 50%"
                             alt="">
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item icon="el-icon-plus">个人中心</el-dropdown-item>
                            <el-dropdown-item icon="el-icon-circle-plus">退出</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
                <div class="header-info-detail ">
                    <div class="header-info-detail-welcome">
                        欢迎您，管理员
                    </div>
                    <div class="header-info-detail-date">
                        2020.12.18 15:00pm
                    </div>
                </div>
            </div>
        </el-header>
        <!--        内容区-->
        <el-container>
            <!--            侧边栏-->
            <el-aside width="auto">
                <!--                菜单-->
                <menu-bar></menu-bar>
            </el-aside>
            <el-container>
                <el-main style="padding:0;">
                    <tab class="tab"></tab>
                    <div style="margin-top: 50px">
                        <router-view></router-view>
                    </div>

                </el-main>
                <el-footer>绍兴柯桥东宁纺织有限公司</el-footer>
            </el-container>
        </el-container>
    </el-container>
</template>

<script>
    // @ is an alias to /src
    import MenuBar from "../components/MenuBar"
    import Tab from "../components/Tab"
    import {mapMutations, mapState,mapActions} from 'vuex'

    export default {
        name: "Home",
        components: {
            MenuBar,
            Tab
        },
        computed: {
            ...mapState({isCollapse: state => state.menustore.isCollapse})
        },
        mounted() {
            // 页面加载时获取后台加入的数据 菜单导航和用户信息
            // 采用vuex
            // this.getMenuList(this.$router);
        },
        data() {
            return {};
        },
        methods: {
            ...mapActions({
                getMenuList:"loginstore/getMenuListAction"
            }),
            ...mapMutations({
                arrowBtn: "menustore/setOpenOrClose",

            }),
            iconClick(){
                console.log("点击")
                this.arrowBtn();
            }

        }
    };
</script>

<style lang="scss" scoped>
    .el-tabs__header{
        position: static!important;
    }
    .arrowIcon {
        font-size: 25px;
        border: 1px solid transparent;
        height: 39px;
        width: 50px;
        text-align: center;
        line-height: 39px !important;
    }
    .home {
    }
    .header {
        background-color: #b3c0d1;
        color: white;
        .header-title{
            font-size: 25px;
            font-weight: 500;
        }

    }
    .header-info {
        height: 60px;
        .header-info-avatar {
            width: 60px;
            height: 60px;
            padding-right: 10px;
        }
        .header-info-detail {
            div {
                height: 30px;
                line-height: 30px;
                font-size: 13px;
            }
            .header-info-detail-welcome {
                font-size: 14px;
                font-weight: 400;
            }
        }
    }
    .tab{
        position: absolute;
        width: calc(100% - 220px);
        left: 215px;
        top: 68px;
        background-color: #ffffff;
    }
    .el-footer {
        background-color: #b3c0d1;
        color: #333;
        text-align: center;
        line-height: 60px;
    }

    .el-aside {
        color: #333;
        text-align: center;
        line-height: 200px;
        min-height: 600px;
        border-right: 1px solid #b3c0d1;
    }




</style>
